package cn.rxls.community.controller;

import cn.rxls.community.result.Result;
import cn.rxls.community.vo.contractConfirm.ContractConfirmVO;
import cn.rxls.community.service.ContractConfirmService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;

import java.util.List;

/**
 * 合同确认内容(ContractConfirm)表
 */
@RestController
@RequestMapping("contractConfirm")
@Validated
public class ContractConfirmController {
    /**
     * 服务对象
     */
    @Resource
    private ContractConfirmService contractConfirmService;

    /**
     * 根据类型查询所有数据
     *
     * @param category 类型
     * @return 所有数据
     */
    @GetMapping("/all/category")
    public Result<List<ContractConfirmVO>> selectAllByCategory(@Valid
                                                               @NotBlank(message = "非法类型")
                                                               @RequestParam(value = "category", required = false) String category) {
        return Result.success(contractConfirmService.selectAllByCategory(category));
    }


}

